package co.fitstart.entity.site;

import com.demo2do.core.utils.Alias;

@Alias("roomType")
public enum RoomType {
    
    COMMON("common", "公共空间"),
    
    ROOM("room", "私密空间");
    
    private RoomType(String alias, String description) {
        this.alias = alias;
        this.description = description;
    }
    
    private String alias;
    
    private String description;
    
    /**
     * 
     * @param alias
     * @return
     */
    public static RoomType aliasOf(String alias) {
        for (RoomType roomType : RoomType.values()) {
            if (roomType.getAlias().equalsIgnoreCase(alias)) {
                return roomType;
            }
        }
        return null;
    }
    
    public boolean isCommon() {
        return this.equals(COMMON);
    }
    
    public boolean isRoom() {
        return this.equals(ROOM);
    }
    
    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }
}
